-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add stake percentage + operator address to ejection reporting (dataapi + cli) #815
Conversation
70808f0
to
3d4cfdd
Compare
776b519
to
d2bb6f3
Compare
Ejections DataAPI response
|
Adds second table ordered by ejection txn Sort results in descending order Consolidate table logic Add stake percentage calculation to ejection report Add stake percentage to operator ejections data api Update swagger Fix id->address mapping Lint
498bd74
to
3fc378b
Compare
44c12d4
to
6fb398a
Compare
for _, ejection := range operatorEjections { | ||
previouseBlock := ejection.BlockNumber - 1 | ||
if _, exists := stateCache[previouseBlock]; !exists { | ||
state, err := s.chainState.GetOperatorState(context.Background(), uint(previouseBlock), []uint8{0, 1}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would be a good way to pass in/out the quorum information in the report. Not something immediately clear to me what the best option would be. Not even sure if we eject quorum2 at all. I don't think we need to address it here. But put a note somewhere would be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored to construct an ordered slice of the set of quorums.
subgraphApi := subgraph.NewApi(config.SubgraphEndpoint, config.SubgraphEndpoint) | ||
subgraphClient := dataapi.NewSubgraphClient(subgraphApi, logger) | ||
|
||
ejections, err := subgraphClient.QueryOperatorEjectionsForTimeWindow(context.Background(), int32(config.Days), config.OperatorId, config.First, config.Skip) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this section of code is highly similar to the codeblock above. Create a new function?
bc1c491
to
6cf0f91
Compare
Dataapi + cli tool to generate ejections reports
Outputs 3 tables